# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-telepot
pkgname=('python2-telepot' 'python-telepot')
_pkgname=telepot
pkgver=12.7
pkgrel=9
pkgdesc='Python framework for Telegram Bot API.'
arch=('any')
url='https://pypi.org/project/telepot/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('ea4b2278f9c267a8ec79733283081e3e24be25e7bdde6a1c9226a84aac1e918fd069d4db185402d009cfd8d820696c76411e75f33bbf5b178f2a737f7064044f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-telepot() {
  depends=('python2' 'python2-urllib3')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-telepot() {
  depends=('python' 'python-urllib3')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

